﻿using BCCommon.Enums;
using BCDto.OA.Workflow.WorkflowOperation;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.OA.WorkflowEngine
{
    /// <summary>
    /// 工作流引擎
    /// </summary>
    public interface IWorkflowEngineService
    {
        /// <summary>
        /// 初始化工作流活动实例
        /// </summary>
        /// <param name="workflowKey">工作流Key</param>
        /// <param name="companyId">公司Id</param>
        /// <param name="isTemplateActivity">是否为临时活动(即动态创建的活动实例，并非流程配置好的)</param>
        /// <param name="roleType">角色类型</param>
        /// <param name="instanceNo">带回实例编号</param>
        /// <returns>返回实例Id</returns>
        long InitWorkflowActivityInstance(string workflowKey,int companyId,bool isTemplateActivity, RoleType roleType, ref string instanceNo);
        /// <summary>
        /// 任务执行
        /// </summary>
        /// <param name="workflowOperationRequestDto">工作流操作请求</param>
        void Execution(WorkflowOperationRequestDto workflowOperationRequestDto);
        /// <summary>
        /// 活动步骤下一步
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        void NextStep(long workflowActivityInstanceId);
        /// <summary>
        /// 活动步骤上一步
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        void PreviousStep(long workflowActivityInstanceId);
        /// <summary>
        /// 开始工作流
        /// </summary>
        /// <param name="workflowActivityInstanceId">活动实例Id</param>
        void Start(long workflowActivityInstanceId);
        /// <summary>
        /// 开始已经就绪的工作流
        /// </summary>
        void StateReady();
    }
}
